package com.cuijq.counterv6.reporter;

import com.cuijq.counterv6.service.MetricsStorage;
import com.cuijq.counterv6.service.impl.RedisMetricsStorage;
import com.cuijq.counterv6.utils.Aggregator;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @Classname ConsoleReporter
 * @Description TODO
 * @Date 2021/5/4 15:05
 * @Created by CuiJQ
 */
public class ConsoleReporter extends ScheduleReporter {


  private ScheduledExecutorService executor;

  // 兼顾代码的易用性，新增一个封装了默认依赖的构造函数
  public ConsoleReporter() {
    this(new RedisMetricsStorage(), new Aggregator(), new ConsoleViewer());
  } // 兼顾灵活性和代码的可测试性，这个构造函数继续保留

  public ConsoleReporter(MetricsStorage metricsStorage, Aggregator aggregator, StatViewer viewer) {
    super(metricsStorage, aggregator, viewer);
    this.executor = Executors.newSingleThreadScheduledExecutor();
  }

  public ConsoleReporter(MetricsStorage storage) {
    this(storage, new Aggregator(), new ConsoleViewer());
  }

  public void startRepeatedReport(int i, int i1) {
  }
}
